const express = require("express");
const { login } = require("./modules/login");
const { register } = require("./modules/register");

const app = express();

app.use(express.static("./www"));

app.use(express.urlencoded({extended: false}));

app.get("/login", (req, res, next)=>{
    // 登录
    login()
});

app.post("/register", (req, res, next)=>{
    // req.body
    // 封装数据库操作成自定义模块
    // ...
    // 注册
    register();
});

app.listen(3000, ()=>{
    console.log("服务器开启成功,地址为: http://localhost:3000")
})
